package com.woniuxy.staffservice.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.staffservice.entity.Dept;
import com.woniuxy.staffservice.mapper.DeptMapper;
import com.woniuxy.staffservice.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements DeptService {

    @Autowired
    private DeptMapper deptMapper;

    @Override
    public void add(Dept dept) {
        deptMapper.insert(dept);
    }

    @Override
    public List<Dept> getByPid(Integer pid) {
        return deptMapper.getByPid(pid);
    }

    @Override
    public List<Dept> getByCondition(String name, String address, String description, Integer index, Integer limit) {
        return deptMapper.getByCondition(name, address, description, index, limit);
    }

    @Override
    public void deleteById(int id) {
        deptMapper.deleteById(id);
    }


}
